echo off
echo ======== Compilando JNITest.java ... ==========

set JAVA_JDK="C:\Program Files\Java\jdk1.6.0_22"
set JAVA_HOME="C:\Program Files\Java\jdk1.6.0_22\bin"

IF NOT EXIST %JAVA_JDK% GOTO NOJAVADIR

%JAVA_HOME%\javac br\com\paysmart\experiments\jni\JNITest.java

echo Criando o header com o javah ...
%JAVA_HOME%\javah -jni br.com.paysmart.experiments.jni.JNITest

echo **Pacote JNITest**
rem cd ..\..\..\tmp
rem rmdir /S/Q classes
rem mkdir classes\br\com\smartcon\setp
rem copy br\com\smartcon\setp\JSETP.class  classes\br\com\smartcon\setp
rem copy br\com\smartcon\setp\JSETPConst.class  classes\br\com\smartcon\setp
rem copy br\com\smartcon\setp\JSETPTest.class  classes\br\com\smartcon\setp
rem copy ..\src\SETPJNI\manifest-header.txt .

%JAVA_HOME%\jar -cvf JNITest.jar br\com\paysmart\experiments\jni\*.class
%JAVA_HOME%\jar -uvf JNITest.jar Release\*.dll
echo Assinando o . jar
%JAVA_HOME%\jarsigner -keystore keystore_jarsigner.jks -storepass filicube JNITest.jar 1
rem echo Movendo o . jar
rem copy JSETP.jar ..\bin\win32\

GOTO EXIT

:NOJAVADIR
echo off
echo !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
echo !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
echo !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
echo !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
echo !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
echo !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
echo ERROR: Java directory is invalid!
echo !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
echo !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
echo !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
echo !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
echo !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
echo !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

:EXIT
echo =================FIM=========================
pause
